<?php echo $header; ?>
<div id="content">
<?php if ($error_warning) { ?>
  <div class="alert alert-error"><?php echo $error_warning; ?><a class="close" data-dismiss="alert">×</a></div>
  <?php } ?>
  <?php if ($success) { ?>
  <div class="alert alert-success"><?php echo $success; ?><a class="close" data-dismiss="alert">×</a></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/order.png" alt="" /> <?php echo $heading_title; ?></h1>
      <div class="buttons"><a href="<?php echo $insert; ?>" class="button"><?php echo $button_insert; ?></a><a onclick="$('form').submit();" class="button"><?php echo $button_delete; ?></a></div>
    </div>
    <div class="content">
      <form action="<?php echo $delete; ?>" method="post" enctype="multipart/form-data" id="form">
        <table class="list">
          <thead>
            <tr>
              <td width="1" style="text-align: center;"><input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);" /></td>
              <td class="left">名称</td>
              <td class="left">URL</td>
              <td class="left">token</td>
              <td class="left">appid</td>
              <td class="left">appsecret</td>
               <td class="left">状态</td>
              <td class="right"><?php echo $column_action; ?></td>
            </tr>
          </thead>
          <tbody>
            <?php if ($commons) { ?>
            <?php foreach ($commons as $common) { ?>
            <tr>
              <td style="text-align: center;"><?php if ($common['selected']) { ?>
                <input type="checkbox" name="selected[]" value="<?php echo $common['common_id']; ?>" checked="checked" />
                <?php } else { ?>
                <input type="checkbox" name="selected[]" value="<?php echo $common['common_id']; ?>" />
                <?php } ?></td>
              <td class="left"><?php echo $common['common_name']; ?></td>
              <td class="left"><?php echo $common['url']; ?></td>
              <td class="left"><?php echo $common['token']; ?></td>
              <td class="left"><?php echo $common['appid']; ?></td>
              <td class="left"><?php echo $common['appsecret']; ?></td>
              <td class="left"><?php echo $common['status']; ?></td>
              <td class="right"><?php foreach ($common['action'] as $action) { ?>
                [ <a href="<?php echo $action['href']; ?>"><?php echo $action['text']; ?></a> ]
                <?php } ?></td>
            </tr>
            <?php } ?>
            <?php } else { ?>
            <tr>
              <td class="center" colspan="5"><?php echo $text_no_results; ?></td>
            </tr>
            <?php } ?>
          </tbody>
        </table>
      </form>
      <div class="pagination"><?php echo $pagination; ?></div>
    </div>
  </div>
 </div>
<?php echo $footer; ?> 
